<div class="box" :class="['box-info']">
    <div class="box-header with-border">
        <h3 class="box-title"> 导入商品 </h3> {{ brandId.label }}
    </div>
    <div v-show="result" class="alert alert-dismissible" :class="[ result.ok? 'alert-success' : 'alert-danger']">
        <button @click="result = null" type="button" class="close" aria-hidden="true">&times;</button>
        <h4><i class="icon fa" :class="[ result.ok? 'fa-check' : 'fa-ban']"></i> {{ result.title }}!</h4>
        {{ result.msg }}
    </div>
    <validator name="goodValidation">
        <form class="form-horizontal" novalidate>
            <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">类别</label>
                    <div class="col-sm-10">
                        <select v-model="type" class="form-control">
                            <option v-for="goodType in types" value="{{ goodType.type }}">{{ goodType.label }}</option>
                        </select>
                    </div>
                </div>
                <div v-if="brands[type]" class="form-group">
                    <label class="col-sm-2 control-label">品牌/子类别</label>
                    <div class="col-sm-10">
                        <select v-model="brandId" class="form-control">
                            <option v-for="brand in brands[type]" value="{{ brand.id }}">{{ brand.name }}</option>
                        </select>
                    </div>
                </div>

                <div v-if="goods[brandId]" class="form-group">
                    <label class="col-sm-2 control-label">商品</label>
                    <div class="col-sm-10">
                        <select v-model="goodId" class="form-control">
                            <option v-for="good in goods[brandId]" value="{{ good.id }}">{{ good.name }}</option>
                        </select>
                    </div>
                </div>
            </div>

            <!-- /.box-body -->
            <div class="box-footer">
                <a v-link="{ path: '/good'}" class="btn btn-default">取消</a>
                <button @click="submit" type="button" class="btn pull-right" :class="['btn-info']" >提交</button>
            </div>
            <!-- /.box-footer -->
        </form>
    </validator>
</div>